﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WikiGame.Utilities
{
    public static class LoggedUsersInformation
    {
        private static Dictionary<string, UserInformation> loggedUsers = new Dictionary<string, UserInformation>();

        public static bool AddUserInfo(string username, UserInformation userInformation)
        {
            if (ContainsUserInfoFor(username))
                return false;
            else
                loggedUsers.Add(username, userInformation);
            return true;
        }

        public static bool RemoveUserInfoFor(string username)
        {
            return loggedUsers.Remove(username);
        }

        public static UserInformation GetUserInfoFor(string username)
        {
            return loggedUsers[username];
        }

        public static bool ContainsUserInfoFor(string username)
        {
            return loggedUsers.ContainsKey(username);
        }
    }
}